import sys


# 输出并中断执行
def dd(value):
    print(value)
    sys.exit()


# 判断是否是整型数字
def is_integer(value):
    result = False
    if value is True or value is False:
        return False
    if isinstance(value, int):
        result = True
    return result


# 判断变量是否是数字
def is_numeric(value):
    rS = False
    if isinstance(value, int):
        rS = True
    elif str(value).isdigit():
        rS = True
    elif isinstance(value, float):
        rS = True
    else:
        try:
            float(value)
            rS = True
        except:
            pass
    return rS


# 判断是否是list（数组）
def is_array(value):
    return isinstance(value, list)


def in_array(needle, haystack):
    return needle in haystack


# 函数内部返回
def funReturn(status, msg="", data=""):
    return {'status': status, 'msg': msg, 'data': data}
    # return dict(status=status, msg=msg, data=data)
